<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Vue中的条件渲染</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div v-if="show">{{msg}}</div>
        <div v-else>{{bye}}</div>
        <br>
        <div v-if="test === 'a'">This is an A</div>
        <div v-else-if="test === 'b'">
            This is a B.
        </div>
        <div v-else>
            thinks.
        </div>

        <br>
        <div v-if="show">
            用户名：<input type="text" key="username">
        </div>
        <div v-else>
            邮箱：<input type="text" key="email">
        </div>
    </div>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                msg: 'hello vue!',
                bye: 'Bye vue!',
                test: 'a',
                show: true
            }
        });

    </script>
</body>
</html>